import request from '@/utils/request'

// 查询工单明细列表
export function listOrderInfo(query) {
  return request({
    url: '/procontrol/orderInfo/list',
    method: 'get',
    params: query
  })
}

// 查询工单明细详细
export function getOrderInfo(id) {
  return request({
    url: '/procontrol/orderInfo/' + id,
    method: 'get'
  })
}
// 查询工单明细详细
export function getBgOrderInfo(id) {
  return request({
    url: '/procontrol/orderInfo/getBgOrderInfo/' + id,
    method: 'get'
  })
}

/*报工所需物料*/
export function getBgOrderinfoItem(id) {
  return request({
    url: '/procontrol/orderInfo/getBgOrderinfoItem/' + id,
    method: 'get'
  })
}

// 新增工单明细
export function addOrderInfo(data) {
  return request({
    url: '/procontrol/orderInfo',
    method: 'post',
    data: data
  })
}
//报工
export function addBgOrderInfo(data) {
  return request({
    url: '/procontrol/orderInfo/addBgOrderInfo',
    method: 'post',
    data: data
  })
}
// 接单
export function addJdOrderInfo(data) {
  return request({
    url: '/procontrol/orderInfo/addJdOrderInfo',
    method: 'put',
    data: data
  })
}
// 全部接单
export function addJdAllOrderInfo(id) {
  return request({
    url: '/procontrol/orderInfo/addJdAllOrderInfo/' + id,
    method: 'get'
  })
}

// 修改工单明细
export function updateOrderInfo(data) {
  return request({
    url: '/procontrol/orderInfo',
    method: 'put',
    data: data
  })
}

// 删除工单明细
export function delOrderInfo(id) {
  return request({
    url: '/procontrol/orderInfo/' + id,
    method: 'delete'
  })
}
